package com.dyz.leetcode;

import java.util.ArrayList;
import java.util.List;

public class FindDisappearedNumbers448 {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        int n = nums.length;
        for (int num:nums){
            int x = (num-1)%n;
            nums[x]+=n;
        }
        List<Integer> list = new ArrayList<>();
        for(int i=0; i<n;i++){
            if(nums[i]<=n){
                list.add(i+1);
            }
        }
        return list;
    }
}
